/* eslint-disable */
let toastTimer = false

function toast(content, du) {
    if (toastTimer || !content) {
        return false
    }
    let tipContent = content
    let alertFram = document.createElement('div')
    alertFram.id = 'alertFram'
    alertFram.style = 'position: fixed;bottom: 200px;left: 50%;-webkit-box-sizing: border-box;box-sizing: border-box;max-width: 80%;height: 30px;line-height: 30px;padding: 10px 40px;transform: translateX(-50%);-webkit-transform: translateX(-50%);text-align: center;z-index: 9999;font-size: 14px;color: #fff;border-radius: 40px;background: rgba(0, 0, 0, 0.7);animation: show-toast .5s;-webkit-animation: show-toast .5s;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;top: 50%;margin-top: -40px;bottom: inherit;width: auto;white-space: inherit;height: auto;'
    let strHtml = tipContent
    alertFram.innerHTML = strHtml
        // 将弹框添加到页面末尾
    document.body.appendChild(alertFram)
    setTimeout(() => {
        alertFram.remove()
        toastTimer = false
    }, du ? du : 3000)
}

export { toast }